
<!doctype html>
<head>
        <meta name="keywords" content="羽毛球，球会，球场，教练">
		<meta name="charset" content="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1" />
		
		<script type="text/javascript" src="__PUBLIC__/JS/HomePage/jquery.min.js"></script>
		<script type="text/javascript" src="__PUBLIC__/JS/HomePage/bootstrap.min.js"></script>
		<script type="text/javascript" src="__PUBLIC__/JS/HomePage/md5.js"></script>
		<script type="text/javascript" src="__PUBLIC__/JS/jquery-form.js"></script>
		<script type="text/javascript" src="__PUBLIC__/JS/layer-v2.1/layer/layer.js"></script>
</head>		

<div id="content">	
			 <div><span>现在申请总人数：</span><span id="now_apply_number"></span></div>
			 <div><input type="text" id="name" placeholder="请输入用户名（区分大小写）"/><button onclick="let_in()">批准加入</button></div>
</div>

<script type="text/javascript">
 $(function(){
		$.post('__URL__/applyClubPeople',{'club_id':parent.selected},function(resultList){ 
	
			 ClubJson=resultList.result;var jsonLength=0;
			 
			 for(var name in ClubJson){
             jsonLength++;
             }
			 document.getElementById("now_apply_number").innerHTML=jsonLength;
			 for (var i=0;i<jsonLength;i++)
			 {
			   var com = document.createElement("div");
			   com.innerHTML=ClubJson[i].name;
               document.getElementById("content").appendChild(com);
			 } 
    	     },'json');  
			 
			
		});
		
  function let_in()
  {
     var name=document.getElementById("name").value;
	 $.post('__URL__/permit_join',{'club_id':parent.selected,'name':name},function(resultList) {
	 
	   var msg=resultList.result;;
	   if (msg==0) {layer.msg("批准成功");}
        else {layer.msg("用户名错误");}	   
	 },'json');  
  }
</script>